package com.sxy.dao;

import com.sxy.pojo.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 宋鑫宇
 * @version 1.0
 */
public interface BookDao {

    @Insert("insert into tbl_book values (null,#{type},#{name},#{description})")
    int save(Book book);


    int update(Book book);

    @Delete("delete from tbl_book where id = #{id}")
    int delete(Integer id);

    @Select("select * from tbl_book where id = #{id}")
    Book getById(Integer id);

    @Select("select * from tbl_book")
    List<Book> getAll();
}
